runIf

inline fun <T> T.runIf(check: Boolean, action: T.() -> T): T(source)
inline fun <T> T.runIf(check: (T) -> Boolean, action: T.() -> T): T(source)

Transforms the receiver with the provided action if the check succeeds. Otherwise, returns the unmodified receiver.